﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yu.Cms.Common;

namespace Yu.Cms.Web.UserCtrl.Default
{
    public partial class IndexLink : BaseCtrl
    {
        private string configPath = Config.AggregationFileManager.ConfigFilePath;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.OnStar();
            }
        }
        protected void OnStar()
        {
            XmlLinkSource.DataFile = configPath;
            this.BindLinkLogo();
            this.BindLinkText();
        }

        /// <summary>
        /// 图片链接
        /// </summary>
        private void BindLinkLogo()
        {
            XmlLinkSource.XPath = "/AggregationInfo/Website_FriendLinkList/Link[LinkType=0]";
            RptTextLink.DataSource = XmlLinkSource;
            RptTextLink.DataBind();
        }

        /// <summary>
        /// 文字链接
        /// </summary>
        private void BindLinkText()
        {
            XmlLinkSource.XPath = "/AggregationInfo/Website_FriendLinkList/Link[LinkType=1]";
            RptLogoLink.DataSource = XmlLinkSource;
            RptLogoLink.DataBind();
        }

       

      

    }
}